Skip to content

feat(core): recover repeated @httpQuery params via query_param_all (bug-hunt 1.45)#2293

Merged
vieiralucas merged 1 commit into
mainfrom
bh-mq
Jul 16, 2026
Merged

feat(core): recover repeated @httpQuery params via query_param_all (bug-hunt 1.45)#2293
vieiralucas merged 1 commit into
mainfrom
bh-mq

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

The axum Query<HashMap<String,String>> extraction — and the query_params map on AwsRequest derived from it — collapses repeated query keys, keeping only the last value of ?Id=a&Id=b&Id=c. That silently drops multi-value @httpQuery parameters (list-style filters / ids). This is the known-systemic finding 1.45 (LOW).

raw_query already preserves the full query string, so rather than a repo-wide change to the core representation, this adds first-class recovery:

  • AwsRequest::query_param_all(key) -> Vec<String> — re-parses raw_query and returns every occurrence of a repeated key, in wire order (empty vec if absent).
  • pub(crate) protocol::form_urlencoded_pairs(&str) -> Vec<(String, String)> — decodes into ordered pairs, reusing the existing UTF-8-correct url_decode (the HashMap decoder that collapses repeats is untouched).

Handlers that legitimately accept repeated keys can now recover them without every caller re-implementing query parsing, and without disturbing the query_params fast path every other handler relies on.

Test plan

  • cargo test -p fakecloud-core --lib form_urlencoded_pairs — repeated keys preserved as [a, b, c] (vs the HashMap form collapsing to c); percent/+ decoding (caf%C3%A9+barcafé bar).
  • cargo clippy -p fakecloud-core --tests -- -D warnings clean.

Additive API only — no existing behavior changes, no SDK/docs surface.


Summary by cubic

Adds AwsRequest::query_param_all to return all values of repeated @httpquery params by re-parsing raw_query, fixing the drop of multi-value filters (bug-hunt 1.45). The existing HashMap-based query_params behavior stays unchanged.

  • New Features
    • query_param_all(key) -> Vec returns every occurrence in wire order; empty when absent.
    • pub(crate) form_urlencoded_pairs(&str) -> Vec<(String, String)> decodes ordered key/value pairs (handles percent and +) for internal use.

Written for commit 66ad932. Summary will update on new commits.

Review in cubic

…param_all (bug-hunt 1.45)

The axum `Query<HashMap<String,String>>` extraction — and the `query_params`
map on `AwsRequest` derived from it — collapses repeated query keys, keeping
only the last value of `?Id=a&Id=b&Id=c`. That silently drops multi-value
`@httpQuery` parameters (list-style filters / ids).

`raw_query` already preserves the full query string, so this adds a first-class
accessor `AwsRequest::query_param_all(key) -> Vec<String>` that re-parses it and
returns every occurrence in wire order, plus a `pub(crate)`
`protocol::form_urlencoded_pairs` that decodes into ordered (key, value) pairs
(reusing the existing UTF-8-correct `url_decode`). Handlers that need repeated
keys can now recover them without a repo-wide change to the core representation.

Tests: repeated keys preserved (vs the HashMap collapsing to the last value);
percent/plus decoding.
@vieiralucas
vieiralucas requested a review from Copilot July 16, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vieiralucas
vieiralucas merged commit 3a987f9 into main Jul 16, 2026
181 of 182 checks passed
@vieiralucas
vieiralucas deleted the bh-mq branch July 16, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants